/* ******* Yellow Rotations ******** */

void y1(struct aCube * cube) {
	y1c( cube );
	y1e( cube );
}

void y2(struct aCube * cube) {
	y2c( cube );
	y2e( cube );
}

void y3(struct aCube * cube) {
	y3c( cube );
	y3e( cube );
}

void y1c(struct aCube * cube) {

	short temp = cube[C8].y;
        cube[C8].y = cube[C6].y;
        cube[C6].y = cube[C5].y;
        cube[C5].y = cube[C7].y;
        cube[C7].y = temp;

        temp = cube[C8].o;
        cube[C8].o = cube[C6].b;
        cube[C6].b = cube[C5].r;
        cube[C5].r = cube[C7].g;
        cube[C7].g = temp;

        temp = cube[C8].g;
        cube[C8].g = cube[C6].o;
        cube[C6].o = cube[C5].b;
        cube[C5].b = cube[C7].r;
        cube[C7].r = temp;

	temp = cube[C8].pos;
        cube[C8].pos = cube[C6].pos;
        cube[C6].pos = cube[C5].pos;
        cube[C5].pos = cube[C7].pos;
        cube[C7].pos = temp;
}

void y1e(struct aCube * cube) {

	short temp = cube[E14].y;
        cube[E14].y = cube[E13].y;
        cube[E13].y = cube[E16].y;
        cube[E16].y = cube[E15].y;
        cube[E15].y = temp;

        temp = cube[E14].o;
        cube[E14].o = cube[E13].b;
        cube[E13].b = cube[E16].r;
        cube[E16].r = cube[E15].g;
        cube[E15].g = temp;

	temp = cube[E14].pos;
        cube[E14].pos = cube[E13].pos;
        cube[E13].pos = cube[E16].pos;
        cube[E16].pos = cube[E15].pos;
        cube[E15].pos = temp;
}

void y2c(struct aCube * cube) {

        short temp = cube[C6].y;
        cube[C6].y = cube[C7].y;
	cube[C7].y = temp;
        temp = cube[C5].y;
        cube[C5].y = cube[C8].y;
        cube[C8].y = temp;

        temp = cube[C6].o;
        cube[C6].o = cube[C7].r;
        cube[C7].r = temp;
        temp = cube[C5].b;
        cube[C5].b = cube[C8].g;
        cube[C8].g = temp;

        temp = cube[C6].b;
        cube[C6].b = cube[C7].g;
        cube[C7].g = temp;
        temp = cube[C5].r;
        cube[C5].r = cube[C8].o;
        cube[C8].o = temp;

        temp = cube[C8].pos;
        cube[C8].pos = cube[C5].pos;
        cube[C5].pos = temp;
	temp = cube[C6].pos;
        cube[C6].pos = cube[C7].pos;
        cube[C7].pos = temp;
}

void y2e(struct aCube * cube) {

        short temp = cube[E14].y;
        cube[E14].y = cube[E16].y;
        cube[E16].y = temp;
        temp = cube[E13].y;
        cube[E13].y = cube[E15].y;
        cube[E15].y = temp;

        temp = cube[E14].o;
        cube[E14].o = cube[E16].r;
        cube[E16].r = temp;
        temp = cube[E13].b;
        cube[E13].b = cube[E15].g;
        cube[E15].g = temp;

        temp = cube[E14].pos;
        cube[E14].pos = cube[E16].pos;
        cube[E16].pos = temp;
        temp = cube[E13].pos;
        cube[E13].pos = cube[E15].pos;
        cube[E15].pos = temp;
}

void y3c(struct aCube * cube) {

        short temp = cube[C8].y;
        cube[C8].y = cube[C7].y;
        cube[C7].y = cube[C5].y;
        cube[C5].y = cube[C6].y;
        cube[C6].y = temp;

        temp = cube[C8].o;
        cube[C8].o = cube[C7].g;
        cube[C7].g = cube[C5].r;
        cube[C5].r = cube[C6].b;
        cube[C6].b = temp;

        temp = cube[C8].g;
        cube[C8].g = cube[C7].r;
        cube[C7].r = cube[C5].y;
        cube[C5].y = cube[C6].o;
        cube[C6].o = temp;

        temp = cube[C8].pos;
        cube[C8].pos = cube[C7].pos;
        cube[C7].pos = cube[C5].pos;
        cube[C5].pos = cube[C6].pos;
        cube[C6].pos = temp;
}

void y3e(struct aCube * cube) {

        short temp = cube[E14].y;
        cube[E14].y = cube[E15].y;
        cube[E15].y = cube[E16].y;
        cube[E16].y = cube[E13].y;
        cube[E13].y = temp;

        temp = cube[E14].o;
        cube[E14].o = cube[E15].g;
        cube[E15].g = cube[E16].r;
        cube[E16].r = cube[E13].b;
        cube[E13].b = temp;

        temp = cube[E14].pos;
        cube[E14].pos = cube[E15].pos;
        cube[E15].pos = cube[E16].pos;
        cube[E16].pos = cube[E13].pos;
        cube[E13].pos = temp;
}
